gtkplacessidebar: avoid accessing destroyed popover
authorCarlos Soriano <csoriano@gnome.org>
Wed, 23 Sep 2015 14:13:48 +0000 (16:13 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 24 Sep 2015 03:29:22 +0000 (23:29 -0400)
commit5c0447fa44ee8bfdad7290025a48e5431a9dfb9d
treec8928b2bc4beeb15fb425f9ecd9c804b68735722
parent02306867c3e1fc5c047d569ead9f45fb6f791e7d
gtkplacessidebar: avoid accessing destroyed popover

The row and rename popovers are always relative_to a row.
We also keep a pointer to them so we can interact with them in
callbacks.

However, if the row is destroyed its associated popovers will be
destroyed as well as relative_to destroyes and frees memory of its
associated widget when its relative_to widget is destroyed.
If we, for example, update the places while the popover is shown we are
going to access and invalid widget on the next time.

To avoid that, connect to the destroy signal of the popovers and clean
the sidebar pointers when that happens.

https://bugzilla.gnome.org/show_bug.cgi?id=755444
gtk/gtkplacessidebar.c